package cn.luckdou.system.model.vo;


import cn.luckdou.system.model.country.Country;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by Dadou on 2017/8/4.
 */
public class StateVo implements Serializable{
    private String id;
    private String name ;//州的名字
    private List<Map<String,Object>> list;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<Map<String, Object>> getList() {
        return list;
    }

    public void setList(List<Map<String, Object>> list) {
        this.list = list;
    }

    public void addCountry(Country country, String hm){
        if (list==null){
            list=new ArrayList<>();
        }
        Map<String, Object> map = new HashMap<>();
        map.put("id",country.getId());
        map.put("caname",country.getCaname());
        if (hm!=null && "h".equals(hm)){
            map.put("imgUrl",country.getImgUrl());
        }else{
            map.put("imgUrl",country.getIocUrl());
        }

        map.put("eaname",country.getEaname());
//        map.put("cnamePy",country.getCnamePy());
        list.add(map);

    }
}
